]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Remove unused button width and height arguments and specify button height explicitly
authorMarina Zhurakhinskaya <marinaz@redhat.com>
Tue, 11 Aug 2009 22:10:25 +0000 (18:10 -0400)
committerMarina Zhurakhinskaya <marinaz@redhat.com>
Tue, 11 Aug 2009 22:16:33 +0000 (18:16 -0400)
minWidth and minHeight arguments of the Button class were not used.

Panel buttons need their height to be explicitly specified as
PANEL_HEIGHT to take up full panel height. This fixes the problem with the
user not being able to click at the very top edge of the panel to activate
the button.

js/ui/button.js
js/ui/panel.js

index 60d1d8c2021b98376b3eff35133c43a6595acb14..6ac9649d5549c8f427cddba9e5b7546a746ad286 100644 (file)
@@ -22,12 +22,12 @@ const DEFAULT_FONT = 'Sans Bold 16px';
 // Padding on the left and right side of the button.
 const SIDE_PADDING = 14;
 
-function Button(widget, buttonColor, pressedButtonColor, textColor, staysPressed, minWidth, minHeight, font) {
-    this._init(widget, buttonColor, pressedButtonColor, textColor, staysPressed, minWidth, minHeight, font);
+function Button(widget, buttonColor, pressedButtonColor, textColor, staysPressed, font) {
+    this._init(widget, buttonColor, pressedButtonColor, textColor, staysPressed, font);
 }
 
 Button.prototype = {
-    _init : function(widgetOrText, buttonColor, pressedButtonColor, textColor, staysPressed, minWidth, minHeight, font) {
+    _init : function(widgetOrText, buttonColor, pressedButtonColor, textColor, staysPressed, font) {
         let me = this;
 
         this._buttonColor = buttonColor
@@ -50,11 +50,6 @@ Button.prototype = {
         if (font == null)
             this._font = DEFAULT_FONT;
 
-        if (minWidth == null)
-            minWidth = 0;
-        if (minHeight == null)
-            minHeight = 0;
-
         // if this._staysPressed is true, this._active will be true past the first release of a button, until a subsequent one (the button
         // is unpressed) or until release() is called explicitly
         this._active = false;
@@ -78,9 +73,6 @@ Button.prototype = {
 
         this.button.append(this._widget, Big.BoxPackFlags.EXPAND);
 
-        this._minWidth = minWidth;
-        this._minHeight = minHeight;
-
         this.button.connect('button-press-event',
             function(o, event) {
                 me._isBetweenPressAndRelease = true;
index dda10abebcd96b109f18996df04fb923544aeb3d..fa9d6d047f737bb0da17537b091c30c30f5dd07a 100644 (file)
@@ -252,7 +252,8 @@ Panel.prototype = {
         /* left side */
 
         this.button = new Button.Button("Activities", PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
-                                        PANEL_FOREGROUND_COLOR, true, null, PANEL_HEIGHT, DEFAULT_FONT);
+                                        PANEL_FOREGROUND_COLOR, true, DEFAULT_FONT);
+        this.button.button.height = PANEL_HEIGHT;
 
         this._leftBox.append(this.button.button, Big.BoxPackFlags.NONE);
 
@@ -336,7 +337,8 @@ Panel.prototype = {
                                              PANEL_BUTTON_COLOR,
                                              PRESSED_BUTTON_BACKGROUND_COLOR,
                                              PANEL_FOREGROUND_COLOR,
-                                             true, null, PANEL_HEIGHT);
+                                             true);
+        statusbutton.button.height = PANEL_HEIGHT;
         statusbutton.button.connect('button-press-event', function (b, e) {
             statusmenu.toggle(e);
             return false;